<pre>
#!/bin/bash
# alex - 20141021
# to upgrade specific packages for ubuntu 10 and 12
# since the --only-upgrade option does not work
#

P10="file"
P12="file"
PATCHVER="5.03-5ubuntu1.4"
FLAGS="--only-upgrade"

VERSION=$(/usr/bin/lsb_release -a | /bin/grep Release | /usr/bin/awk '{ print $2 }')
P0=""
if [ $VERSION == "10.04" ]; then
  FLAGS=""
  P0=$P10
elif [ $VERSION == "12.04" ]; then
  P0=$P12
fi

for PKGS in $P0
  do
    if dpkg -s $PKGS  2>/dev/null | grep -q Status.*installed; then
      echo "Attempting to upgrade $PKGS"
      apt-get -y install $FLAGS "$PKGS"
    else
      echo "Package $PKGS is not installed"
    fi
  echo "INSTALLED : " && dpkg -l | grep $PKGS | grep $PATCHVER
done
</pre>
